
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <string.h>

struct msgbuf{
	long type;
	char text[100];
};
int main(void)
{
	int id=msgget(1234,0);

	struct msgbuf sb;
	int num;
	printf("channel:");
	scanf("%d",&num);
	msgrcv(id,&sb,100,num,0);
	printf("%s\n",sb.text);
}
